﻿/*********************************************************************************************************************
VanguardDocumentation, XML Schema SessionVariables

© 2014 Erik Ackerholm

This file is part of SqlVanguard.

SqlVanguard is free software: you can redistribute it and/or modify it under the terms of the GNU General Public 
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later 
version.

SqlVanguard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with SqlVanguard. If not, see 
<http://www.gnu.org/licenses/>.
*********************************************************************************************************************/

if
	not exists (
		select *
		from sys.schemas as s
			inner join sys.xml_schema_collections as x on (s.[schema_id] = x.[schema_id])
		where s.name = 'VanguardDocumentation' and x.name = 'SessionVariables'
	)
begin
	
	create xml schema collection VanguardDocumentation.SessionVariables
	as '<?xml version="1.0" encoding="utf-8"?>
		<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="SessionVariables">
			<xs:element name="Variables">
				<xs:complexType>
					<xs:sequence minOccurs="0">
						<xs:element name="BaseEntity">
							<xs:annotation>
								<xs:documentation>Prefix for names beginning with a dot.</xs:documentation>
							</xs:annotation>
							<xs:complexType>
								<xs:attribute name="Name" type="xs:string" use="required"/>
								<xs:attribute name="Type" type="xs:string"/>
							</xs:complexType>
						</xs:element>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:schema>';
	
end;
GO




